package com.party.core.service.copartner;

import com.party.common.paging.Page;
import com.party.core.model.copartner.BrokerageItem;
import com.party.core.model.copartner.BrokerageListOutput;
import com.party.core.model.member.CopartnerAnalyzeQuery;
import com.party.core.service.IBaseService;

import java.util.List;
import java.util.Map;

/**
 * @Author: Administrator.
 * @Description: 佣金流水
 * @Date:Created in 2017/10/25 0025 上午 11:55.
 */
public interface IBrokerageItemService extends IBaseService<BrokerageItem> {
    BrokerageItem getUnique(BrokerageItem brokerageItem);

    /**
     * 流水列表
     *
     * @param brokerageItem
     * @param page
     * @return
     */
    List<BrokerageListOutput> brokerageList(BrokerageItem brokerageItem, Page page);


    /**
     * 下级合伙人佣金详情表
     * @param brokerageItem
     * @param query
     * @param page
     * @return
     */
    List<BrokerageListOutput> lowerBrokerageDetailList(BrokerageItem brokerageItem, CopartnerAnalyzeQuery query, Page page);

    /**
     * admin_下级合伙人佣金详情表
     * @param brokerageItem
     * @param query
     * @param page
     * @return
     */
    List<BrokerageListOutput> adminlowerBrokerageDetailList(BrokerageItem brokerageItem, CopartnerAnalyzeQuery query, Page page);

    /**
     * 流水列表
     *
     * @param brokerageItem
     * @param page
     * @return
     */
    List<BrokerageListOutput> newBrokerageList(BrokerageItem brokerageItem, Page page);

    /**
     * 佣金流水金额
     *
     * @param partnerId 合伙人编号
     * @param onlyWith  1：可提现/已冻结 2：可提现 3：已冻结
     * @return
     */
    Double getSumTotal(String partnerId, Integer onlyWith);

    /**
     * 统计合伙人佣金
     *
     * @param memberId   用户编号
     * @param endDate    结束日期
     * @param startDate  开始日期
     * @param activityId
     * @return 统计结果
     */
    Double brokerageSum(String memberId, String endDate, String startDate, String activityId);


    /**
     * 统计合伙人佣金
     *
     * @param memberId   用户编号
     * @param activityId 活动编号
     * @return 统计数
     */
    Double brokerageSum(String memberId, String activityId);

    /**
     * 佣金详情
     *
     * @param itemId 佣金id
     * @return
     */
    Map<String, Object> getItemDetail(String itemId);

    /**
     * 获取我的佣金
     *
     * @param partnerId 用户id
     * @param status    状态 1：已结算 2：未结算
     * @param startDate 开始时间
     * @param endDate   结束时间
     * @return
     */
    Double getMyBrokerage(String partnerId, Integer status, String startDate, String endDate, Boolean isContain);

    Double getDisBrokerage(String partnerId, String activityId);

    /**
     * 通过TargetId获取我的佣金
     * @param params 查询参数
     * @return
     */
    Double getMyBrokerageByTargetId(Map<String,Object> params);

    List<BrokerageItem> findByTargetId(String targetId);

    List<BrokerageItem> getWithdrawDateNull(String activityId);

    List<String> distinctActivityId();
}
